<!DOCTYPE html>
<html>
	<head>
		<base href="__ROOT__">
		<meta charset="UTF-8">
		<title>搜索</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<link rel="stylesheet" type="text/css" href="/public/webapp/css/s_base.css" />
		<link rel="stylesheet" type="text/css" href="/public/webapp/css/search.css" />
		<link rel="stylesheet" type="text/css" href="/public/webapp/css/iconfont.css" />
		<link rel="stylesheet" type="text/css" href="/public/webapp/css/swiper.min.css" />
		<link rel="stylesheet" type="text/css" href="/public/webapp/css/s_valide.css" />
	</head>
	<body>
		<div class="search_top clearfix">
			<form action="/index.php?g=Wechat&m=Webmine&a=sousuofan" method="post" id="form">
				<input type="text" class="left" id="ser" name="ser" id="" value="" placeholder="请输入小区名称/大厦名称/商圈名称"/>
				<input type="hidden" name="list" class="l_id" value="">
				<input type="submit" class="right" value="搜索"/>
			</form>  
		</div>
		<div class="history_search">
			<p>历史搜索</p>
			<div class="search_wrap">
	
			</div>
		</div>
		<div class="hot_search">
			<p>热门搜索</p>
			<div class="search_wrap">

			</div>
		</div>
	</body>
	
	<script src="/public/webapp/js/jquery-1.11.0.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="/public/webapp/js/Validform_v5.3.2_min.js" type="text/javascript" charset="utf-8"></script>
	<script src="/public/webapp/js/s_common.js" type="text/javascript" charset="utf-8"></script>
	
	<script>
	var url={
		history:'/index.php?g=Wechat&m=Webmine&a=lishi',
		hot:'/index.php?g=Wechat&m=Webmine&a=remen'
	}
	$.fn.bianli=function(url){
	var $self=$(this);
	$.ajax({
		type:"post",
		url:url,
		data:{},
		dataType:"json",
		success:function(data){
		if(data.length!=0){
		var html="";
		for(var i=0;i<data.length;i++){
			html+='<span onclick="sc(this);">'+data[i].name+'</span>'
		}
		  $self.append(html);
		}
		}
	});
	}
	var sc=function(self){
		$("#ser").val(self.value);
		$("#form")[0].submit();
	}
	$(".history_search .search_wrap").bianli(url.history);
	$(".hot_search .search_wrap").bianli(url.hot);
   var inputSref=function(){
       var url=document.URL;
       var start=url.indexOf("#")+1;
       var stop=url.length;
       var str=url.substring(start,stop);
       var vals=str=="zulin"?2:str=="ershou"?3:str=="xinfang"?1:"";
        if(url.indexOf("#")!=-1){
           $(".l_id").val(vals);
         }
   }
   inputSref();
	</script>
</html>
